/**
 * Created by kenz on 2018/4/10.
 */
import React from 'react'
import PropTypes from 'prop-types'

class Todo extends React.Component {
  render() {
    const { text, onClick, completed } = this.props
    return (
      <li
        onClick={onClick}
        style={{ textDecoration: completed? 'line-through' : 'none' }}
      >{ text }</li>
    )
  }
}

Todo.propTypes = {
  onClick: PropTypes.func.isRequired,
  text: PropTypes.string.isRequired,
  completed: PropTypes.bool.isRequired
}

export default Todo